﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RuiJing.Web.Areas.Manage.Models.ProductModels.ProductTypeModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	分类管理
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="typepath">
        <%=Html.ActionLink("分类管理：", "type") %>
        <% foreach (var item in Model.Parents) %>
        <% { %>
        &nbsp;&gt;&nbsp;
        <% if (item.ID == Model.ID) %>
        <% { %><a href="javascript:;" title='<%=item.Name_En %>'><%=item.Name_Ch %></a><% } %>
        <% else %>
        <% { %><%=Html.ActionLink(item.Name_Ch, "type", new { id = item.ID }, new { title = item.Name_En })%><% } %>
        <% } %>
    </div>
    <div class="typechilds">
        <ul>
            <% foreach (var item in Model.Childs) %>
            <% { %>
            <li>
                <%=Html.ActionLink(item.Name_Ch, "type", new { id = item.ID }, new { title = item.Name_En })%>
                <%=Html.ActionLink("编辑", "edittype", new { id = item.ID }, new { @class = "a3" }) %>
                <%=Html.ActionLink("删除", "deltype", new { a = item.ID, id = Model.ID }, new { @class = "a3", onclick = "return confirm('您确定要删除该分类吗？\\r\\n如果该分类下存在产品，删除将失败。')" })%>
            </li>
            <% } %>
        </ul>
    </div>
    <div>
    <% Html.BeginForm("type", "product", new { id=Model.ProductType.ParentID}); %>
        <fieldset class="editset">
            <legend>新增分类</legend>
            <%=Html.ValidationMessage("EditError") %>
            <ul class="editpanel">
                <li class="edititem">
                    <label for="Name_Ch" class="label">中文名称：</label>
                    <span class="spans">
                        <%=Html.TextBoxFor(p=>p.ProductType.Name_Ch) %>
                        <%=Html.ValidationMessageFor(p=>p.ProductType.Name_Ch) %>
                    </span>
                </li>
                <li class="edititem">
                    <label for="Name_En" class="label">英文名称：</label>
                    <span class="spans">
                        <%=Html.TextBoxFor(p=>p.ProductType.Name_En) %>
                        <%=Html.ValidationMessageFor(p=>p.ProductType.Name_En) %>
                    </span>
                </li>
                <li class="edititem btnpanel">
                    <input type="submit" value="添加分类" />
                </li>
            </ul>
        </fieldset>
        <%=Html.HiddenFor(p=>p.ProductType.ID) %>
        <%=Html.HiddenFor(p=>p.ProductType.ParentID) %>
    <% Html.EndForm(); %>
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StypeAndScript" runat="server">
    <style type="text/css">
        .typepath{ width:100%; }
        .typechilds { border-bottom:1px solid #888;}
        .typechilds,.typechilds ul{ height:auto; overflow:hidden;width:100%}
        .typechilds li{ height:25px; padding:3px 5px; width:150px; text-align:center; float:left;}
    </style>
</asp:Content>